<?php 


/** 
***************************************************
*欢迎使用免费版xSite企业自助建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.php.net.cn/xsite/ 
***************************************************
**/



  header("Cache-Control: no-cache, must-revalidate"); header("Content-type: text/html;charset=utf-8"); require_once "m.inc.php"; ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<title><?=$site_title?></title>
<script>var ENV_MONITOR = {}, WPO = {}; WPO.data = {dcl: [+ new Date]};</script>
<style type="text/css">
body, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td {
	margin: 0;
	padding: 0
}
table {
	border-collapse: collapse;
	border-spacing: 0
}
fieldset, img {
	border: none
}
address, caption, cite, code, dfn, em, strong, th, var {
	font-style: normal;
	font-weight: normal
}
ol, ul {
	list-style: none
}
caption, th {
	text-align: left
}
h1, h2, h3, h4, h5, h6 {
	font-size: 100%;
	font-weight: normal
}
input, textarea, select {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit
}
input, textarea, select {
 *font-size: 100%
}
legend {
	color: #000
}
body {
	background: #f2f2f2;
	font-family: 'Microsoft YaHei', Hei, arial, sans-serif;
}
/* 头条 */
#hotword > li span {
	display: inline-block;
	height: 33px;
	text-indent: 0;
}
#hotword-anim-wrapper {
	height: 33px;
	overflow: hidden;
}
#hotword-expand {
	display: none;
}
#hotword-expand li {
	background: #EBDDD3;
	border-bottom: 1px solid #DBBEA8;
	height: 33px;
}
#hotword-expand li:last-child {
	border-bottom: none;
}
#hotword-wrapper {
	height: auto;
}
#indicator2 {
	background-color: #EBDDD3;
	display: none;
}
#indicator2 li {
	float: left;
	position: relative;
	height: 100%;
	width: 50%;
}
#indicator2 span {
	position: absolute;
	bottom: 3px;
	display: inline-block;
	width: 64px;
	height: 3px;
	background-color: #D6BAA4;
}
#indicator2 li.active span {
	background-color: #4BB37D;
}
#indicator2 li:first-child span {
	right: 5px;
}
#indicator2 li:last-child span {
	left: 5px;
}
#hotword-wrapper {
	/*height: 33px;*/
	line-height: 33px;
	/*
	 background-image: url(skin/hotword.png);
	 background-color: #F2E6DD;
	 background-position: 14px 19px;
	 background-size: 7px 5px;
	 background-repeat: no-repeat;
	 */
	/*#F2E6DD必须有*/
	background: url(skin/hotword.png) #F2E6DD 7px 5px no-repeat;
	background-size: 14px 19px;
	border-bottom: 1px solid #E3CAB7;
	color: #B3784B;
	font-size: 15px;
	text-indent: 32px;/*overflow: hidden;*/
}
#hotword-wrapper {
/*<bg-image> || <bg-position> [ / <bg-size> ]? || <repeat-style> || <attachment> || <box>{1,2} */
	/*background: url(resource/img/hotword.png) 7px center/14px 19px no-repeat, url(resource/img/arrow.png) right center/9px 6px no-repeat;*/
}
#hotword-wrapper-after {
	/*content:'';*/
	display: block;
	width: 39px;
	height: 33px;
	top: 0;
	right: 0;
	position: absolute;
	/*background: url(skin/arrow.png) center center/9px 6px no-repeat; */
	background: url(skin/arrow.png) center center no-repeat;
	background-size: 9px 6px;
	-webkit-transform: rotate(180deg) translateZ(0);
}
#horword {
	margin-right: 39px;
}
#hotword-wrapper.down #hotword-wrapper-after {
	-webkit-transform: rotate(0) translateZ(0);
}
#hotword-wrapper {
	position: relative;
}
#hotword-wrapper::before {
 content: '头条:';
 position: absolute;
}
#hotword > li {
	text-indent: 74px;
}
#ex-scroller li {
	position: relative;
}
#ex-scroller li::before {
 position: absolute;
 content: '';
 width: 6px;
 height: 6px;
 left: 15px;
 top: 13px;
 border-radius: 3px;
 background-color: #D3A888;
}
#hotword.anim {
	-webkit-transform: translate(0px, -33px) scale(1) translateZ(0px);
	-webkit-animation-name: horword;
	-webkit-animation-duration: 1s;
	-webkit-animation-iteration-count: 1;
	-webkit-animation-timing-function: linear;
}
 @-webkit-keyframes horword {
 from {
 -webkit-transform: translate(0px, 0px) scale(1) translateZ(0px);
}
to {
	-webkit-transform: translate(0px, -33px) scale(1) translateZ(0px);
}
}
* {
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/**
 *
 * Vertical Scrollbar
 *
 */
.myScrollbarV {
	position: absolute;
	z-index: 100;
	width: 4px;
	bottom: 7px;
	top: 2px;
	right: 1px
}
.myScrollbarV > div {
	position: absolute;
	z-index: 100;
	width: 100%;
	/* The following is probably what you want to customize */
	background: -webkit-gradient(linear, 0 0, 100% 0, from(#BEBEBD), to(#6A6968));
	background-image: -moz-linear-gradient(top, #f00, #900);
	background-image: -o-linear-gradient(top, #f00, #900);
	border: 1px solid #BEBEBD;
	-webkit-background-clip: padding-box;
	-moz-background-clip: padding-box;
	-o-background-clip: padding-box;
	background-clip: padding-box;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-o-box-sizing: border-box;
	box-sizing: border-box;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	-o-border-radius: 4px;
	border-radius: 4px;
	-webkit-box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.5);
	-moz-box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.5);
	-o-box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.5);
	box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.5);
}
.hidden {
	display: none;
}
.focus {
	position: relative; /*indicator 定位*/
	z-index: 99; /*遮住头条动画*/
}
#focus-wrapper {
	position: relative;
	/*height: 160px;*/
	overflow: hidden;
}
#focus-scroller {
	float: left; /* 横向排列 */
	height: 100%;
	width: 300%;
}
#focus-scroller > li {
	position: relative;
	float: left;
	width: 33.33%;
	/*height: 160px;*/
	text-align: center;
	background-color: #F1F1F1;
}
#focus-scroller > li img {
	display: block;
	width: 100%;
}
.focus-title {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 29px;
	line-height: 29px;
	text-indent: 11px;
	text-align: left;
	background: rgba(51, 51, 51, 0.74);
	font-size: 13px;
	color: #D1D1D1;
}
#indicator {
	position: absolute;
	bottom: 0;
	right: 0;
	z-index: 4;
	width: 40px;
	height: 29px;
	line-height: 29px;
	padding-top: 12px;
	box-sizing: border-box;
}
#indicator > li {
	float: left;
	text-indent: -9999em;
	width: 8px;
	height: 8px;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	-o-border-radius: 4px;
	border-radius: 4px;
	background: #DDD;
	overflow: hidden;
	margin-right: 4px;
}
#indicator > li.active {
	background: #888;
}
#indicator > li:last-child {
	margin: 0;
}
/* 首页粗体 */
b {
	font-weight: normal;
}
/* 新闻列表 */
.news-list li {
	background: #fff;
	border-bottom:1px solid #e8e8e8;
}
.news-list li:hover {
	background: #f9f9f9;
}
.news-list li a {
	color: #888;
	display: block;
	overflow: hidden;
	padding: 15px 9px 9px 15px;
	position: relative;
	text-decoration: none;
}
.news-list .news-text h3 {
	color: #333;
	font-size: 20px;
}
.news-list .news-text p {
	display: none;
}
.news-list .news-text h3 .hot, .news-list .news-text h3 .cmd {
	background: url(skin/t012cc2745d537ab1bb.png) no-repeat;
	background-size: 100%;
	height: 38px;
	left: 0;
	position: absolute;
	top: -1px;
	width: 42px;
	zoom:0.5;
}
.news-list .news-text h3 .hot {
	background-position: 0 -40px;
}
.news-list .news-img {
	float: right;
	margin-left: 11px;
	width: 25%;
}
.news-list .pic3 {
	font-size: 15px;
	margin-bottom: -15px;
	margin-top: 15px;
	text-align: justify;
}
.news-list .pic3 img {
	width: 30%;
}
.news-list .pic3:after {
	content: "";
	display: inline-block;
	width: 100%;
}
.news-list .info {
	clear: both;
	color: #cecece;
	font-size: 12px;
	margin-top: 6px;
}
.news-list .info site {
	display: inline-block;
	margin-right: 16px;
	max-width: 10em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.news-list .info site, .news-list .info time {
	vertical-align: top;
}
.visited .news-desc, .visited .news-title, .visited .news-title {
	color: #888;
}
/**************** 导航切换 ****************/
#hd_topnav {
	background: #f7f7f7;
	height: 40px;
	padding-right: 10px
}
#hd_topnav ul {
	display: -webkit-box;
}
#hd_topnav li {
	height: 40px;
	text-align: center;
	-webkit-box-flex: 1;
}
#hd_topnav li span, #hd_topnav li a {
	border-bottom: 2px solid #f7f7f7;
	color: #4a4a4a;
	display: block;
	height: 20px;
	line-height: 20px;
	margin: 0 5px;
	padding: 9px 0 9px;
	text-decoration: none;
	white-space: nowrap;
}
#hd_topnav li span {
	color: #36b711;
	border-bottom: 2px solid #3eaf1e
}
#hd_topnav li a {
	color: #4a4a4a
}
#hd_logobar {
	background: #44b651;
	border-bottom: 1px solid #3ca222;
	display: -webkit-box;
	height: 42px;
}
#hd_logobar .logo {
	text-align: center;
	-webkit-box-flex: 1;
}
#hd_logobar .logo a {
	background: url(skin/t01d6e71794540596ef.png) no-repeat;
	display: inline-block;
	height: 15px;
	margin-top: 15px;
	width: 79px;
}
#hd_logobar .useimg {
	padding: 5px 8px 0;
}
#hd_logobar .useimg span, #hd_logobar .home a, #hd_logobar .search a, #hd_logobar .download a {
	background: #3ca047;
	border: 1px solid #3a9045;
	border-radius: 3px;
	display: inline-block;
	height: 30px;
	width: 32px;
}
#hd_logobar .useimg span {
	color: #fff;
	font-size: 14px;
	height: 31px;
	line-height: 31px;
	text-align: center;
	width: 45px;
}
#hd_logobar .home {
	padding: 5px 0 0 8px;
}
#hd_logobar .search {
	padding: 5px 5px 0;
}
#hd_logobar .home a, #hd_logobar .search a, #hd_logobar .download a {
	position: relative;
}
#hd_logobar .home a:before {
	background: url(skin/t01d6e71794540596ef.png) no-repeat 0 -40px;
	content: '';
	height: 17px;
	left: 7px;
	position: absolute;
	top: 7px;
	width: 19px;
}
#hd_logobar .search a:before {
	background: url(skin/t01d6e71794540596ef.png) no-repeat 0 -20px;
	content: '';
	height: 16px;
	left: 8px;
	position: absolute;
	top: 7px;
	width: 17px;
}
#hd_logobar .download a:before {
	background: url(skin/t01d6e71794540596ef.png) no-repeat -20px -20px;
	content: '';
	height: 18px;
	left: 7px;
	position: absolute;
	top: 6px;
	width: 19px;
}
#hd_logobar .download {
	padding: 5px 8px 0 0;
}
#nav-holder {
	height: 44px;
}
#nav-wrapper {
	background: #f1f1f2;
	height: 45px;
	overflow: hidden;
	width: 100%;
}
#nav-scroller {
	display: inline-block;
	text-align: center;
	white-space: nowrap;
}
#nav-scroller li {
	display: inline-block;
	margin-top: 6px;
}
#nav-wrapper a {
	color: #626262;
	display: inline-block;
	font-size: 15px;
	height: 36px;
	line-height: 32px;
	padding: 0 10px;
	text-decoration: none;
}
#nav-wrapper a:visited {
	color: #626262;
}
#nav-wrapper .active a {
	border-bottom:3px solid #43b550;
	color:#37a043;
}
#focus, #hotword-wrapper {
	display: none
}
#loading, #loadError {
	padding: 150px 0 300px;
	text-align: center;
	background: url(skin/news_logo_bg.png) no-repeat center 100px;
	background-size: 150px 25px
}
#loading-more, #load-more {
	margin: 8px 15px 0;
	height: 39px;
	line-height: 39px;
	border: 1px solid #D0D0D0;
	text-align: center;
	font-size: 15px;
	border-radius: 4px;
}
#loading-more #loadmoreReload {
	width: 100%;
	height: 100%
}
.fix {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 100
}
#loadingReload {
	width: 40px;
	height: 40px;
	margin: 10px auto;
	background: url(skin/reload.png) no-repeat
}
#loading div {
	width: 32px;
	height: 32px;
	margin: 0 auto;
	background: url(skin/loading.gif) no-repeat
}
/**************** Suggestion ****************/
.suggest-container, .suggest-container* {
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0)
}
.suggest-container {
	display: none;
	position: relative;
	border: 1px solid #bbb;
	border-top: 0;
	z-index: 9;
	background: white
}
.suggest-item, .suggest-toolbar {
	display: -webkit-box;
	line-height: 22px;
	-webkit-box-pack: start;
	-webkit-box-align: stretch
}
.suggest-item {
}
.suggest-toolbar {
	-webkit-box-pack: end;
	color: #969696;
	background-color: #f8f8f8
}
.suggest-item-title {
	display: block;
	color: #333;
	font-size: 16px;
	font-family: 'microsoft yahei', hei, arial, sans-serif;
	padding-left: 8px;
	-webkit-box-flex: 1;
	background: none transparent;
	-webkit-appearance: none;
	text-align: left;
	border: none;
	border-bottom: 1px solid #bbb;
	line-height: 28px
}
.suggest-item-add {
	border: none;
	border-bottom: 1px solid #bbb;
	display: block;
	width: 52px;
	background: url('skin/t0129eae3267053f012.png') no-repeat scroll center center white;
	background-size: 13px 11px
}
.suggest-item-title .match {
	color: #afafaf
}
.fill-all {
	-webkit-box-flex: 1
}
.suggest-item-title.touched {
}
.suggest-item-add.touched {
	background-color: #f4f4f4
}
.suggest-clearhistory {
	display: none;
	width: 107px;
	border-right: 1px solid #bbb;
	line-height: 32px
}
.suggest-history .suggest-clearhistory {
	display: block
}
.suggest-close {
	line-height: 32px;
	text-align: center;
	padding: 0 12px;
	font-size: 16px;
	width: 55px;
	border-left: 1px solid #bbb
}
.suggest-close.touched {
	background-color: #d6fdc4
}
</style>
</head>
<body>
<style>
#hd_download{
	background: #515459;
	height: 68px;
	position: relative;
}
#hd_download .close{
	background: url(skin/t01d6e71794540596ef.png) no-repeat -60px -20px;
	height: 17px;
	left: 3px;
	position: absolute;
	top: 3px;
	width: 17px;
}
#hd_download .applogo img{
	border-radius: 7px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.5);
	height: 47px;
	left: 29px;
	position: absolute;
	top: 11px;
	width: 47px;
}
#hd_download .info{
	color: #d8d9db;
	font-size: 12px;
	padding: 15px 0 0 93px;
}
#hd_download .info dt{
	font-size: 16px;
	height: 22px;
	text-shadow: 0 1px 2px rgba(0,0,0,0.44);
}
#hd_download .info a{
	color:#fff;
	text-decoration:none;
}
#hd_download .download{
	background: -webkit-linear-gradient(#3ba547,#235329);
	border-radius:3px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.34);
	padding: 1px;
	position: absolute;
	right: 27px;
	top: 20px;
}
#hd_download .download a{
	background: -webkit-linear-gradient(#3fad4c,#2f973c);
	border-radius:2px;
	color: #fff;
	display: block;
	font-size: 12px;
	height: 26px;
	line-height: 26px;
	padding: 0 8px;
	text-decoration: none;
}
#hd_download .download a:before{
	background: url(skin/t01d6e71794540596ef.png) no-repeat -40px -20px;
	content: '';
	display: inline-block;
	height: 14px;
	margin: -2px 4px 0 0;
	vertical-align: middle;
	width: 14px;
}
</style>
<?php if (isset($mobi_open_topad) && $mobi_open_topad == 1) {?>
<div id="hd_download">
  <p class="close"></p>
  <p class="applogo"><img src="skin/app.png" alt="" /></p>
  <dl class="info">
    <dt><a href="http://<?=_e("{$site_url}{$site_path}/m/download.php?src=dimecode", 'www.xsite.cn')?>">下载APP</a></dt>
    <dd><a href="http://<?=_e("{$site_url}{$site_path}/m/download.php?src=dimecode", 'www.xsite.cn')?>">更多精彩展现</a></dd>
  </dl>
  <p class="download"><a href="http://<?=_e("{$site_url}{$site_path}/m/download.php?src=dimecode", 'www.xsite.cn')?>">立即下载</a></p>
</div>
<script>
(function(){
	var $dl=document.getElementById('hd_download')
	if(document.cookie.match(/(^|;)?hd_download=([^;]*)(;|$)/)){
		document.body.removeChild($dl)
	}else{
		$dl.getElementsByClassName('close')[0].addEventListener('click',function(){
			var d=new Date();
			d.setFullYear(d.getFullYear()+3)
			document.cookie='hd_download=1;expires='+d.toGMTString();
			document.body.removeChild($dl)
		})
	}
})();
</script>
<?php }?>
<div id="page-wrapper">
  <style>
/* header */
.ios .noIos{display:none;}
.header{font-family:arial;font-size:15px;border-bottom:1px solid #D0D0D0;background-color:#EEE;display:block;}
.header .top{height:40px;background-color:#FAFAFA;}
.header .icon{float:left;width:50px;height:100%;border-right:1px solid #D5D5D5;background:url(skin/icons.png) no-repeat;background-size:150px 112px}
.header .icon a{display:block;width:100%;height:100%;}
.header .icon.active{background-color:#eee}
.header .toSoIndex{background-position:-49px 11px;}
.header .toSoIndex.active{background-position:-49px -36px;}
.header .moreTabs{background-position:-116px 11px;}
.header .moreTabs.active{background-position:-116px -36px;}
.header .search{background-position:16px 11px;}
.header .search.active{background-position:16px -36px;}
.header .noPic,
.header .search{float:right;border-left:1px solid #D5D5D5;border-right:none;}
.header .noPic{text-align:center;line-height:40px;color:#fff;background:none;}
.header .logo{height:100%;}
.header .logo a{display:block;width:112px;height:100%;text-align:center;margin:0 auto;}
.header .logo img{height:16px;margin-top: 12px;}
.header .logo.new a::before{content:'';width:4px;height:4px;border-radius:50%;background-color:#FF2400;border:1px solid #fff;box-shadow:0 1px 1px #777;float:right;margin:5px 0 0 -5px;}

.tabList ,
.searchBox{overflow:hidden;display:none;border-top:1px solid #D0D0D0;box-shadow: inset 0 0 1px rgba(0,0,0,0.15);}
.tabList a{float:left;width:20%;height:45px;line-height:45px;text-align:center;color:#333;text-decoration:none;}

.searchBox{padding:10px;}
.searchBox .con{height:100%;padding:5px 50px 5px 5px;border:1px solid #D0D0D0;background-color:#fff;position:relative;}
.searchBox .keyWords{height:28px;width:100%;border:none;border-right:1px solid #D4D4D4;outline: none;border-radius:0;}
.searchBox .searchBn{width:50px;height:40px;right:0;top:0;position:absolute;padding:0;background-position:18px 10px;border:none;}

/* for news */
.header.news .top{background-color:#45B952;}
.header.news .icon{border-color:#3B9E47}
.header.news .icon.active{background-color:#3A9C45}
.header.news .toSoIndex,
.header.news .toSoIndex.active{background-position:-49px -83px;}
.header.news .moreTabs,
.header.news .moreTabs.active{background-position:-116px -83px;}
.header.news .search,
.header.news .search.active{background-position:16px -83px;}
.header .clear{position: absolute;right:52px;top:0;width:36px;height:100%;font-size: 30px;color: #9c9c9c;text-align: center;line-height: 38px;background-color: #fff;display: none;-webkit-text-size-adjust:none;}
</style>
  <header class="header news" id="header">
    <div class="top"> 
    	<span class="toSoIndex icon"><a href="http://<?=_e("{$site_url}{$site_path}/m/")?>"></a></span> 
        <span class="moreTabs icon"></span> 
        <span class="search icon"></span>
        <span class="noPic icon" id="showImg">无图</span>
      	<h1 class="logo"><a href="http://<?=_e("{$site_url}{$site_path}/m/")?>"><img src="<?=SITE_PATH . '/' . @thumb(_e($mobi_logofile, "m/skin/mobi_logo.png"), 186, 32)?>" alt=""/></a></h1>
    </div>
    
    <div class="tabList"> 
    <?php if(is_array($cat_links) && count($cat_links)) {?>
        <?php foreach($cat_links as $k => $v) {?>
         	<a href="<?=$v['href']?>" data-search="<?=$v['href']?>"><?=@str_sub(_e($v['name'], "名称"), 4, '')?></a> 
        <?php }?>
    <?php }?>
    </div>
    <div class="searchBox">
      <form class="searchForm" action="http://<?=_e("{$site_url}{$site_path}/m/search.php")?>">
        <div class="con">
          <input type="text" name="q" class="keyWords" autocomplete="off" id="q"/>
          <input type="submit" name="" value="" class="searchBn icon"/>
          <span class="clear">×</span> </div>
      </form>
    </div>
    <div id="nav-holder">
      <div id="nav-wrapper">
        <ul id="nav-scroller">
          <li class="active"><a href="#index">首页</a></li>
          <?php foreach($system_tree_category as $k => $v) {?>
	          <?php if(in_array($v['module'], array('article', 'product', 'page') )) {?>
	          <li><a href="#<?=$k?>"><?=@str_sub(_e($v['name'], "名称"), 8, '')?></a></li>
	          <?php }?>
          <?php }?>
        </ul>
      </div>
    </div>
  </header>
  <script>
(function(){
            if(!!navigator.userAgent.match(/(i[^;]+\;(U;)? CPU.+Mac OS X)/)){
                document.body.classList.add('ios');
            }
            if(!getCookie('_notNew')){
                setCookie('_notNew',1,1000*60*60*24*365);
                if(document.referrer.indexOf('<?=($site_url)?>')>=0)
                    document.querySelector('h1.logo').classList.add('new');
            }

             var links = document.querySelectorAll(".header a[data-search]"),
            q=document.getElementById('q');
            for(var i = links.length - 1; i >=0; i--){
                links[i].addEventListener("click", function(e){
                    if(q.value != ""){
                        var dataSearch = this.getAttribute("data-search");
                        if(dataSearch){
                            this.href = dataSearch + encodeURIComponent(q.value);
                        }
                    }
                    e.stopPropagation();
                }, false);
            }
            var tabList=document.querySelector('.header .tabList'),
            searchBox=document.querySelector('.header .searchBox'),
            tabBn=document.querySelector('.header .moreTabs'),
            searchIco=document.querySelector('.header .search'),
            clear=document.querySelector('.header .clear'),
            f1=0,f2=0;
            
            tabBn.addEventListener('touchstart',function(){
                if(f1^=1){
                    this.className='moreTabs icon active';
                    tabList.style.display="block";
                  }else{
                    this.className='moreTabs icon';
                    tabList.style.display="none";
                  }
                f2=0;
                searchIco.className='search icon';
                searchBox.style.display="none";
            },false);

            searchIco.addEventListener('touchstart',function(){
                if(f2^=1){
                    this.className='search icon active';
                    searchBox.style.display="block";
                }else{
                    this.className='search icon';
                    searchBox.style.display="none";
                }
                f1=0;
                tabBn.className='moreTabs icon';
                tabList.style.display="none";
            },false);

            if(q.value){
              clear.style.display="block";
            }

            function getCookie(name){
                var exp=new RegExp("(?:;)?"+encodeURIComponent(name)+"=([^;]*);?");
                if(exp.test(document.cookie))
                    return decodeURIComponent(RegExp['$1']);
                else return null;
            }
            function setCookie(name, value, expires, path, domain){
                if( expires && !isNaN(expires)) expires=new Date(new Date().getTime()+expires);
                document.cookie=name+"="+escape(value)+(expires?"; expires="+expires.toGMTString():"")+(path?"; path="+path:"; path=/")+(domain?";domain="+domain:"");
            }
        })();
</script> 
  <!-- 轮播图 Start -->
  <div id="focus" class="focus">
    <div class="wrapper" id="focus-wrapper">
      <ul class="scroller" id="focus-scroller">
      
        <li class="news-item" data-m="Ssd" data-url="<?=_e($mobi_banner_ad1_link, "http://{$site_url}{$site_path}/m/")?>" data-img="<?=SITE_PATH . '/' . @thumb(_e($mobi_banner_ad1, "m/skin/mobi_banner_ad1.jpg"), 400, 200)?>">
          <div class="focus-title"><?=@str_sub(_e($mobi_banner_ad1_name, "在后台输入标题"), 20, '')?></div>
        </li>
        <li class="news-item" data-m="Ssd" data-url="<?=_e($mobi_banner_ad2_link, "http://{$site_url}{$site_path}/m/")?>" data-img="<?=SITE_PATH . '/' . @thumb(_e($mobi_banner_ad2, "m/skin/mobi_banner_ad2.jpg"), 400, 200)?>">
          <div class="focus-title"><?=@str_sub(_e($mobi_banner_ad2_name, "在后台输入标题"), 20, '')?></div>
        </li>
        <li class="news-item" data-m="Ssd" data-url="<?=_e($mobi_banner_ad3_link, "http://{$site_url}{$site_path}/m/")?>" data-img="<?=SITE_PATH . '/' . @thumb(_e($mobi_banner_ad3, "m/skin/mobi_banner_ad3.jpg"), 400, 200)?>">
          <div class="focus-title"><?=@str_sub(_e($mobi_banner_ad3_name, "在后台输入标题"), 20, '')?></div>
        </li>
                
      </ul>
    </div>
    <ul id="indicator">
      <li class="active">1</li>
      <li>2</li>
      <li>3</li>
    </ul>
  </div>
  <!-- 轮播图 End --> 
  
  <!-- 热点资讯 Start -->
  <?php $hot_list = tpl_article_list("limit=10&status=8"); $hot_list = $hot_list['list']; ?>
  <?php if(is_array($hot_list) && count($hot_list)) {?>
  <div id="hotword-wrapper">
    <div id="hotword-anim-wrapper">
      <ul id="hotword">
      <?php foreach ($hot_list as $k => $v) {?>
        <li><span data-q="key=<?=$v['key']?>&category=<?=$v['category']?>"><?=@str_sub(_e($v['body_name'], "没有标题"), 20, '…')?></span></li>
      <?php }?>
      </ul>
      
      <div id="hotword-wrapper-after"></div>
    </div>
    <div id="hotword-expand" style="width: 100%; overflow: hidden;">
      <div id="ex-scroller" style="width: 200%;">
        <div style="width: 50%;float: left;">
          
          <ul>
          <?php $i = 0; ?>
          <?php foreach ($hot_list as $k => $v) {?>
          	<?php if ($i >= 5) break;?>
            <li><span data-q="key=<?=$v['key']?>&category=<?=$v['category']?>"><?=@str_sub(_e($v['body_name'], "没有标题"), 26, '…')?></span></li>
            <?php $i++;?>
          <?php }?>
          </ul>
          
        </div>
        <div style="width: 50%;float: left;">
          <ul>
            
          <?php $i = 0; $hot_list = array_reverse($hot_list); ?>
          <?php foreach ($hot_list as $k => $v) {?>
          	<?php if ($i >= 5) break;?>
            <li><span data-q="key=<?=$v['key']?>&category=<?=$v['category']?>"><?=@str_sub(_e($v['body_name'], "没有标题"), 20, '…')?></span></li>
            <?php $i++;?>
          <?php }?>
            
          </ul>
        </div>
      </div>
    </div>
    <ul id="indicator2" style="height: 15px;">
      <li class="active"><span></span></li>
      <li><span></span></li>
    </ul>
  </div>
  <?php }?>
  <!-- 头条 End --> 
  
  <!-- 新闻列表 Start -->
  <ul class="news-list" id="news-list">
    <li id="loading">
      <div></div>
    </li>
  </ul>
  <!-- 新闻列表 End -->
  <div id="load-more" style="display:none">加载更内容</div>
  <div id="loading-more" style="display:none">正在加载中...</div>
</div>
<script>WPO.data.dcl.push(+ new Date);</script> 
<script src="skin/iScroll.js"></script><!-- iScroll v4.2.5 --> 
<script src="skin/4f1853e5.js"></script> 
<script type="text/javascript" src="skin/zepto.js"></script> 
<script type="text/javascript">
// src2="http://s3.qhimg.com/static/30fe65d3ad8e94ff.js"
var touchScroll = function(holder, scroller, speed, scrollEndFunc){
	this.holder = $("#" + holder);
	this.scroller = $("#" + scroller);
	this.speed = speed;
	this.scrollEndFunc = scrollEndFunc || function(){};
	this.init();
}
touchScroll.prototype = {
	init : function(){
		var _this = this;
		_this.minDistance = 10;
		_this.startPos = {x : 0, y : 0};
		_this.pointX = 0;
		_this.enableScroll = false;
		_this.dir = "";
		_this.scrollWidth = _this.holder.width();
		_this.totalWidth = _this.scroller.width();
		_this.currPage = 1;
		_this.totalPage = Math.floor(_this.totalWidth / _this.scrollWidth);
		_this.maxWidth = _this.totalWidth - _this.scrollWidth;
		
		_this.holder.on("touchstart", function(e){_this.start(e);});
		_this.holder.on("touchmove", function(e){_this.move(e);});
		_this.holder.on("touchend", function(e){_this.end(e);});
		$(window).on("resize", function(){_this.refresh();});
	},
	refresh : function(){
		var _this = this;
		_this.scrollWidth = _this.holder.width();
		_this.totalWidth = _this.scroller.width();
		_this.maxWidth = _this.totalWidth - _this.scrollWidth;
		_this.scrollToPage(_this.currPage);
	},
	start : function(e){
		var _this = this;
		_this.startPos.x = e.touches[0].pageX;
		_this.startPos.y = e.touches[0].pageY;
		_this.enableScroll = false;
	},
	move : function(e){
		var _this = this;
		var pageX = e.touches[0].pageX;
		var pageY = e.touches[0].pageY;
		var diffX =  pageX - _this.startPos.x;
		var diffY =  pageY - _this.startPos.y;
		
		_this.dir = diffX > 0 ? "right" : "left";
		
		if(Math.abs(diffX) > _this.minDistance && Math.abs(diffX) > Math.abs(diffY)){
			e.preventDefault();
			
			var x = _this.pointX + diffX;
			if(_this.dir == "right"){
				x -= _this.minDistance;
			}else{
				x += _this.minDistance;
			}
			if(x < -_this.maxWidth || x > 0){
				return;
			}
	
			_this.scroller[0].style.webkitTransform = 'translate(' + x + 'px, 0px) scale(1) translate3d(0,0,0)';
			_this.enableScroll = true;	
		}
	},
	end : function(e){
		var _this = this;
		if(!_this.enableScroll){
			return;
		}
		_this.enableScroll = false;
		var x = 0;
		if(_this.dir == "right"){
			x = _this.pointX + _this.scrollWidth;
			_this.currPage--;
		}else{
			x = _this.pointX - _this.scrollWidth;
			_this.currPage++;
		}
		if(x < -_this.maxWidth){
			x = -_this.maxWidth;
		}
		if(x > 0){
			x = 0;
		}
		if(_this.currPage > _this.totalPage){
			_this.currPage = _this.totalPage;
		}
		if(_this.currPage < 1){
			_this.currPage = 1;
		}
		_this.pointX = x;
		_this.scroller[0].style.webkitTransform = 'translate(' + x + 'px, 0px) scale(1) translate3d(0,0,0)';
		_this.scroller[0].style.webkitTransitionProperty = 'transform';
		_this.scroller[0].style.webkitTransitionDuration = _this.speed + 's';
		_this.scroller[0].style.webkitTransitionTimingFunction = "cubic-bezier(0.33,0.66,0.66,1)";
		
		_this.scrollEndFunc(_this.currPage);
	},
	scrollToPage : function(index){
		var _this = this;
		var x = (1 - index) * _this.scrollWidth;
		_this.pointX = x;
		_this.scroller[0].style.webkitTransform = 'translate(' + x + 'px, 0px) scale(1) translate3d(0,0,0)';
		_this.scroller[0].style.webkitTransitionProperty = 'transform';
		_this.scroller[0].style.webkitTransitionDuration = _this.speed + 's';
		_this.scroller[0].style.webkitTransitionTimingFunction = "cubic-bezier(0.33,0.66,0.66,1)";
		
		_this.currPage = index;
		_this.scrollEndFunc(_this.currPage);
	}
}



var news = {
	ele : {
		holder : $("#news-list"),
		more : $("#load-more"),
		loadingMore : $("#loading-more"),
		focus : $("#focus"),
		hotwordWrapper : $("#hotword-wrapper"),
		showImg : $("#showImg"),
		nav : $("#nav-wrapper")
	},
	data : {
		cats : [],
		currCat : "",
		cache : {},
		num : 20,
		maxNum : 160,
		ajax : null,
		hotwordAnimTimer : null,
		hotScroll : null,
		focusScroll : null,
		isShowImg : 1,
		needToTop : true,
		loading : '<li id="loading"><div></div></li>',
		loadingError : '<li id="loadError">加载失败，请点击刷新。<div id="loadingReload"></div></li>',
		loadmore : '正在加载中...',
		loadmoreError : '<div id="loadmoreReload">加载失败，点击重新加载。</div>',
		request : {
			//"news" : "http://sh.qihoo.com/api/webapp/topnews.json?num=",
			"news" : "http://<?=$site_url?><?=$site_path?>/m/data.php?f=jsonp&callback=?&h=1&fr=mn&n=",
			//"news" : "data.php?num=",
			"others" : "http://<?=$site_url?><?=$site_path?>/m/index.php?c=Clientapi&a=class&cls={cat}&limit="
			//"others" : "data.php?c=Clientapi&a=class&cls={cat}&limit="
		}
	},
	init : function(){
		var _this = this;
		_this.fixNav();
		_this.getCats();
		_this.getHash();
		_this.getImgFlag();
		_this.initCat();
		_this.initLinks();
		_this.initScroll();
		_this.initHotword();
		_this.startHotwordAnim();
		_this.loadData(false);
		_this.initMore();
	},
	//固定导航
	fixNav : function(){
		var _this = this;
		$(window).on("scroll touchmove", function(){
			if($(document.body).scrollTop() > $(_this.ele.nav).parent().offset().top){
				_this.ele.nav.addClass("fix");
			}else{
				_this.ele.nav.removeClass("fix");
			}
		});
	},
	//初始化滚动，导航使用iscroll，
	//焦点图只在头条频道出，焦点图使用touchScroll，无图设置时，不显示焦点图
	initScroll : function(){
		var _this = this;
		
		new iScroll('nav-wrapper', {
			scrollbarClass: 'myScrollbar',
			bounce: false,
		});
		if(_this.data.isShowImg){
			_this.loadFocusImg();
			_this.data.focusScroll = new touchScroll("focus-wrapper", "focus-scroller", .5, function(index){
				$("#indicator .active").removeClass("active");
				$("#indicator li").eq(index - 1).addClass("active");
			});
		}
	},
	//头条滚动
	initHotScroll : function(){
		var _this = this;
		_this.data.hotScroll = new touchScroll("hotword-expand", "ex-scroller", .5, function(index){
			$("#indicator2 .active").removeClass("active");
			$("#indicator2 li").eq(index - 1).addClass("active");
		});
	},
	initHotword : function(){
		var _this = this;
		
		$('#hotword-anim-wrapper').bind('tap', function() {
			var $wrapper = $('#hotword-wrapper');
	
			if ($wrapper.hasClass('down')) {
				$wrapper.removeClass('down');
				$('#hotword-expand').hide();
				$('#indicator2').hide();
				$('#hotword li').removeClass('hidden');
				_this.startHotwordAnim();
			} else {
				$wrapper.addClass('down');
				$('#hotword-expand').show();
				$('#indicator2').show();
				$('#hotword li').addClass('hidden');
				_this.stopHotwordAnim();
				
				if(_this.data.hotScroll){
					_this.data.hotScroll.refresh();
				}else{
					_this.initHotScroll();
				}
			}
		});
	},
	//加载焦点图
	loadFocusImg : function(){
		var _this = this;
		$("#focus-scroller li").each(function(index, element){
			var li = $(element);
			var url = li.data("img");
			if(url){
				li.prepend($("<img src='" + url + "' />"));
			}
		});
	},
	startHotwordAnim : function(){
		var _this = this;
		_this.data.hotwordAnimTimer = setInterval(function() {
			$('#hotword').addClass('anim');
			setTimeout(function() {
				$('#hotword li').first().appendTo($('#hotword'));
				$('#hotword').removeClass('anim');
			}, 1500);
		}, 3000);
	},
	stopHotwordAnim : function(){
		clearInterval(this.data.hotwordAnimTimer);
	},
	//有图无图设置
	getImgFlag : function(){
		var _this = this;
		
		var flag = _this.getCookie("showimg");
		if(flag != "" && flag == "0"){
			_this.data.isShowImg = 0;
			_this.ele.showImg.html("有图");
		}else{
			_this.data.isShowImg = 1;
			_this.ele.showImg.html("无图");
		}
		
		_this.ele.showImg.on("click", function(){
			if(_this.data.isShowImg == "1"){
				_this.setCookie("showimg", "0", {expireDays : 365, path : "/"});
			}else{
				_this.setCookie("showimg", "1", {expireDays : -1, path : "/"});
			}
			location.reload();
		});
	},
	setCookie : function(name, value, option){
		var str = name + "=" + encodeURIComponent(value);
		if(option){
			if(option.expireDays){
				var date = new Date();
				var ms = option.expireDays*24*3600*1000;
				date.setTime(date.getTime() + ms);
				str += "; expires=" + date.toGMTString();
			}
			if(option.path) str += "; path=" + option.path;
			if(option.domain) str += "; domain" + option.domain;
			if(option.secure) str += "; secure";
		}
		document.cookie = str;
	},
	getCookie : function(name){
		var cookieArray = document.cookie.split("; ");
		for(var i = 0; i < cookieArray.length; i++){
			var arr = cookieArray[i].split("=");
			if(arr[0] == name) return decodeURIComponent(arr[1]);
		}
		return "";
	},
	//获得各频道分类，分类名称与ajax请求参数有关联
	getCats : function(){
		var _this = this;
		$("#nav-scroller a").each(function(index, element) {
			_this.data.cats.push(element.getAttribute("href").replace("#",""));
        });
		if(_this.data.cats.length > 0){
			_this.data.currCat = _this.data.cats[0];
		}
	},
	//从地址栏获得锚点，以判断要加载哪个频道
	getHash : function(){
		var _this = this;
		var hash = location.hash;
		if(hash){
			hash = hash.replace("#", "");
			if(_this.checkCat(hash)){
				_this.data.currCat = hash;
			}
		}
	},
	checkCat : function(cat){
		return $.inArray(cat, this.data.cats) > -1 ? true : false;
	},
	//初始化频道、焦点图、头条展示状态，以及页面自动滚动到导航位置
	initCat : function(){
		var _this = this;
		$("#nav-scroller").on("click", "a", function(){
			var cat = this.getAttribute("href").replace("#","");
			
			if($(document.body).scrollTop() >= 83){
				_this.data.needToTop = true;
				_this.scrollToView();
			}else{
				_this.data.needToTop = false;
			}
			
			if(_this.checkCat(cat) && cat != _this.data.currCat){
				_this.data.currCat = cat;
				_this.loadData(false);
				
			}
			//设置选中状态
			_this.setSelected();
			_this.displayOtherArea();
			
		});
		_this.setSelected();
		_this.displayOtherArea();
	},
	//部分链接点击后的页面跳转
	initLinks : function(){
		// 点击新闻跳转到转码页
		$(document.body).on('tap', '.news-item', function(event) {
			if ($(this).hasClass('type-zhuanti')) {
				window.location = $(this).data('url');return;
			}
			var m = $(this).data('m'),
				url = $(this).data('url'),
				src = event.target.parentNode.id === 'focus-scroller' ? 'home_focus' : 'home',
				href = 'http://<?=_e("{$site_url}{$site_path}/m/")?>ns.php?a=newtranscode&ofmt=html&src=' + src + '&m=' + encodeURIComponent(m) + '&u=' + encodeURIComponent(url);
			window.location = href;
		});
	
		$('#hotword-wrapper [data-q]').on('tap', function(event) {
		//$('#hotword-wrapper').on('click', '[data-q]', function(event) {
			event.preventDefault();
			event.stopPropagation();
	
			var href= 'http://<?=_e("{$site_url}{$site_path}/m/")?>/ns.php?&src=home_hotword&u=' + encodeURIComponent($(this).data('q'));
			window.location = href;
		});
	},
	displayOtherArea : function(){
		var _this = this;
		
		if(_this.data.currCat == "index"){
			if(_this.data.isShowImg){
				_this.ele.focus.show();
			}
			_this.ele.hotwordWrapper.show();
			if(_this.data.focusScroll){
				_this.data.focusScroll.refresh();
			}
		}else{
			if(_this.ele.focus){
				_this.ele.focus.hide();
			}
			_this.ele.hotwordWrapper.hide();
		}
	},
	//导航选中样式
	setSelected : function(){
		$("#nav-scroller li.active").removeClass("active");
		$("#nav-scroller li").has('a[href="#' + this.data.currCat + '"]').addClass("active");
	},
	//加载更多按钮事件
	initMore : function(){
		var _this = this;
		$("#load-more").on("click", function(){
			_this.loadData(true);
		});
		$("#loading-more").delegate("#loadmoreReload","click",function(){
			_this.loadData(true);
		});
	},
	//ajax加载数据
	loadData : function(isLoadMore){
		var _this = this,
			dataType = "jsonp";
//			dataType = "json";
		var cacheData = _this.data.cache[_this.data.currCat];
		//如果有缓存数据，且不需要加载更多时，显示缓存数据
		if(typeof cacheData != "undefined" && !isLoadMore){
			_this.displayResult();
		}else{
			//var url = _this.data.request["others"].replace(/{cat}/gi, _this.data.currCat) + _this.data.num;
			var url =  _this.data.request["news"]+ _this.data.num + "&u=" + monitor.util.getGuid();
			if(_this.data.currCat !== "index"){
				url += "&c=" + _this.data.currCat;
				//url += "&pos=" + _this.data.cache[_this.data.currCat].pos;
			}
			
			/*if(_this.data.ajax){
				_this.data.ajax.abort();
			}*/
			_this.data.ajax = $.ajax({
				'url' : url,
				'type' : 'get',
				'dataType' : dataType,
				'beforeSend' : function(){
					if(isLoadMore){
						_this.showLoadingMore();
					}else{
						_this.showLoading();
					}
					_this.hideMoreBtn();
				},
				'error' : function(){
					if(isLoadMore){
						_this.showLoadingMoreError();
					}else{
						_this.showLoadingError();
					}
				},
				'success' : function(_data){
					if(!_data){return;}
					if(_data.code === 0 || _data.length > 0) {
						_this.saveData(_data);
						_this.displayResult(isLoadMore);
						if(!isLoadMore && _this.data.needToTop){
							_this.scrollToView();
						}
					}else{
						if(isLoadMore){
							_this.showLoadingMoreError();
						}else{
							_this.showLoadingError();
						}
					}
				}
			});
		}
	},
	scrollToView : function(){
		//if($(document.body).scrollTop() < 83){
			//window.scrollTo(0, 83);
			var _this = this;
			$("body>*")[0].scrollIntoView(true);
		//}
	},
	//显示loading
	showLoading : function(){
		this.ele.holder.html(this.data.loading);
	},
	//显示loading失败
	showLoadingError : function(){
		this.ele.holder.html(this.data.loadingError);
		$("#loadingReload").click(function(){
			location.reload();
		});
	},
	//显示加载更多的loading
	showLoadingMore : function(){
		var _this = this;
		_this.ele.loadingMore.html(_this.data.loadmore).show();
		_this.hideMoreBtn();
	},
	//隐藏加载更多的loading
	hideLoadingMore : function(){
		this.ele.loadingMore.hide();
	},
	//加载更多loading失败
	showLoadingMoreError : function(){
		var _this = this;
		_this.ele.loadingMore.html(_this.data.loadmoreError).show();
	},
	showMoreBtn : function(){
		this.ele.more.show();
	},
	hideMoreBtn : function(){
		this.ele.more.hide();
	},

	//数据去重
	isExist : function(obj){
		var _this = this;
		var flag = false;
		var cat = _this.data.currCat;
		var results = _this.data.cache[cat].result;
		///出于调试开发，暂时注释掉
		for(var i = 0; i < results.length; i++){
			var _title = "t", _url = "u";
			if(obj[_title] == results[i][_title] || obj[_url] == results[i][_url]){
				flag = true;
				break;
			}
		}
		//*/
		return flag;
	},
	//缓存数据
	saveData : function(data){
		var _this = this , pos = 0;
		var cat = _this.data.currCat;
		if ($.isArray(data)) {
			data = data
		}else{
			pos = data.pos;
			data = data.result;
		}
		if(typeof _this.data.cache[cat] == "undefined"){
			_this.data.cache[cat] = {};
			_this.data.cache[cat].result = data;
			_this.data.cache[cat].total = 0;
		}else{
			//去重后增加
			data.forEach(function(item){
				if(!_this.isExist(item)){
					_this.data.cache[cat].result.push(item);
				}
			});
		}
		/*if(cat == "index"){
			//_this.data.cache[cat].pos = _this.data.num + data.pos;
		}else{
			//_this.data.cache[cat].pos = data.pos;
		}*/
		_this.data.cache[cat].total += _this.data.num;
	},
	//展示结果list
	displayResult : function(isLoadMore){
		var _this = this;
		var cat = _this.data.currCat;
		var data = _this.data.cache[cat].result;
		var html = [],
			reg = /\.123\.com\/((dr|dm)\/\d+_\d+_\/)?/,
			replStr = ".123.com/dmfd/182_136_/";
		
		if(cat){
			var tpl = '<li class="news"><a href="{{_url}}" api="{{_api}}">{{img}}<div class="news-text"><h3>{{t}}{{_hot}}</h3><p>{{s}}</p></div>{{img3}}<div class="info"><site>{{f}}</site><time>{{p}}</time></div></li>';
			//var tpl = '<li class="news"><a href="{{_url}}" api="{{_api}}">{{img}}<div class="news-text"><h3>{{title}}{{_hot}}</h3><p>{{description}}</p></div>{{img3}}<div class="info"><site>{{domain}}</site><time>{{p}}</time></div></li>';
			data.forEach(function(item, index, array) {
				item.img = ' ';
				item.img3 = ' ';
				if(_this.data.isShowImg && item.i){
				//if(_this.data.isShowImg && item.image_url){
					var _img=item.i.replace(/^\|+|\|+$/,'').replace(/\|+/,'|').split('|');
					//var _img=item.image_url.replace(/^\|+|\|+$/,'').replace(/\|+/,'|').split('|');
					if(_img.length<2){
						item.img = '<img class="news-img" src="' + _img[0].replace(reg,replStr) + '">';
					}else if(_img.length>2){
						var _img3=[ '<p class="pic3">'];
						for(var ii=0;ii<3;ii++){
							_img3.push('<img src="' + _img[ii].replace(reg,replStr) + '"> ');
						}
						_img3.push('</p>');
						item.img3 = _img3.join('');
					}
				}
				item._url = 'http://<?=_e("{$site_url}{$site_path}/m/")?>ns.php?a=newtranscode&ofmt=html&src=home&m=' + encodeURIComponent(item.m) + '&u=' + encodeURIComponent(item.u);
				//item._url = 'http://<?=_e("{$site_url}{$site_path}/m/")?>ns.php?a=newtranscode&ofmt=html&src=home&m=' + encodeURIComponent(item.m) + '&u=' + encodeURIComponent(item.url);
				item._api = 'http://tran.m.so.com/newsTrans?ofmt=json&m=' + encodeURIComponent(item.m) + '&u=' + encodeURIComponent(item.u);
				//item._api = 'http://tran.m.so.com/newsTrans?ofmt=json&m=' + encodeURIComponent(item.m) + '&u=' + encodeURIComponent(item.url);
				item._hot = "";
				if(item.a=='g'){
					item._hot='<span class="hot"></span>'
				}else if(item.a=='l'){
					item._hot='<span class="cmd"></span>'
				}
				item.p = _this.formatDate(item.p);
				//item.p = _this.formatDate(item.recordTime);
				var str = tpl.replace(/{{([^{}]+)}}/g, function(match, p1) {
					return item[p1];
				});
				html.push(str);
			});
		}else{
			var tpl = '<li><a href="{{_url}}">{{_imgurl}}<div class="news-text"><h3>{{newstitle}}</h3><p>{{description}}</p></div><div class="info"><site>{{src}}</site><time>{{pdate}}</time></div></a></li>';
			//var tpl = '<li><a href="{{_url}}">{{_imgurl}}<div class="news-text"><h3>{{newstitle}}</h3><p>{{description}}</p></div><div class="info"><site>{{src}}</site><time>{{recordTime}}</time></div></a></li>';
			data.forEach(function(item, index, array) {
				if(_this.data.isShowImg && item.imgurl){
					item._imgurl = '<img class="news-img" src="' + item.imgurl.replace(reg,replStr) + '">';
				}else{
					item._className = '';
					item._imgurl = '';
				}
				item._url = 'http://<?=_e("{$site_url}{$site_path}/m/")?>ns.php?a=newtranscode&ofmt=html&src=home&m=' + encodeURIComponent(item.m) + '&u=' + encodeURIComponent(item.newsurl);
				var str = tpl.replace(/{{([^{}]+)}}/g, function(match, p1) {
					return item[p1];
				});
				html.push(str);
			});
		}
		/*if(cat == "index" && isLoadMore === true)
			_this.ele.holder.append(html.join(""));
		else*/
			_this.ele.holder.html(html.join(""));
		
		//达到最大显示条数时，不再显示'更多按钮'
		if(_this.data.cache[cat].total >= _this.data.maxNum){
			_this.hideMoreBtn();
		}else{
			_this.showMoreBtn();
		}
		_this.hideLoadingMore();
	},
	formatDate : function (pdate) {
		var p = new Date(pdate),
			timestamp = p.getTime(),
			date = new Date();
        // 如果时间差 < 1秒，则修正为1秒钟前
        var delta = date - timestamp < 1000 ? 1000 : date - timestamp;
        delta = Math.floor(delta/1000);
        // 规则1: 小于1分钟的，显示xx秒钟前
        if (delta < 60) {
            return delta + '秒钟前';
        }   
    
        // 规则2: 小于1小时的，显示xx分钟前
        if (delta < 3600) {
            return Math.floor(delta/60) + '分钟前';
        }   

        // 规则3: 大于等于1小时，并且是今天内的，显示今天H:i
        if (date.getMonth() == p.getMonth() &&  date.getDate() == p.getDate()) {
            return '今天' + (p.getHours() < 10 ? "0"+p.getHours() : p.getHours()) + ":" 
            + (p.getMinutes() < 10 ? "0"+p.getMinutes() : p.getMinutes());
        }

        // 规则4: 大于等于1小时，并且是昨天内的，显示昨天H:i
       var yd = new Date(date - 24*60*60*1000); //昨天
       if (yd.getMonth() == p.getMonth() &&  yd.getDate() == p.getDate()) {
            return '昨天' + (p.getHours() < 10 ? "0"+p.getHours() : p.getHours()) + ":" 
            + (p.getMinutes() < 10 ? "0"+p.getMinutes() : p.getMinutes());
        } 

        // 规则5: 比昨天还早的，显示Y-m-d H:i
        return pdate.replace(/(.+:\d+):\d+/,"$1");
    } 
};
news.init();
</script> 
<script>

(function() {
    
    function G(id){
        return document.getElementById(id);
    }
    function Q(_className){
        return document.getElementsByClassName(_className);
    }
    
    //如果是iphone/ipad，则不展示[应用]
    //G("app-icon").style.display = /iphone|ipad|ipod|ios/gi.test(navigator.userAgent) ? "none" : "block";
    
    var searchInputBox = G("q"), qs = Q('q'), resets = Q('search-box-reset');
    //轮询搜索框是否有query，如果有则显示"关闭"
    setInterval(function(){
        for (var i = qs.length - 1; i >= 0; i--) {
            if(qs[i].value != ""){
                resets[i].style.display = "block";
            }else{
                resets[i].style.display = "none";
            }
        }
    }, 50);
    
    //点击X，清空query
    for (var i = qs.length - 1; i >= 0; i--) {
        (function(i) {
            resets[i].addEventListener('click', function(event) {
                qs[i].value = '';
                qs[i].focus();
                event.preventDefault();
                event.stopPropagation();
            }, false);
        })(i);
    }
    
    //更多菜单，显示/隐藏
    /*G("nav-more").addEventListener("click", function(e){
        var searchBox = G("search-box"), arrMore = G("arr-more");
        if(searchBox.className == "search-box"){
            searchBox.className = "search-box show-more";
            arrMore.className = "up";
        }else{
            searchBox.className = "search-box";
            arrMore.className = "";
        }
    }, false);*/
    
    //导航菜单切换及query关键字携带
    var links = G("header").querySelectorAll("a[data-search]");
    for(var i = links.length - 1; i >=0; i--){
        links[i].addEventListener("mousedown", function(e){
            if(searchInputBox.value != ""){
                var dataSearch = this.getAttribute("data-search");
                if(dataSearch){
                    this.href = dataSearch + encodeURIComponent(searchInputBox.value);
                }
            }
            e.stopPropagation();
        }, false);
    }

        //输入框聚焦时，"无图"不显示
        $("#q").focus(function(){
            $("#showImg").hide();
        }).blur(function(){
            $("#showImg").show();
        });
})();
</script> 

<script type="text/javascript">
// 获取location.href信息
var getUrlParams = function(strKeys) {
    //var url = url || location.search;
    var keys = strKeys.split(','),
        pattern = '',
        ret = [];

    for (var i = 0, len = keys.length; i < len; i++) {
        if (i > 0) {
            pattern += '|';
        }
        pattern += '[?&](' + encodeURIComponent(keys[i]) + '=[^&]*)';
    }

    location.search.replace(new RegExp(pattern, 'g'), function(match) {
        var parts = match.substr(1).split('=');
        ret[parts[0]] = decodeURIComponent(parts[1]);
    });

    return ret;
};

</script> 
<script>
//initSoMonitor('m_news', 'home');
var params = getUrlParams('src');
params.fe = WPO.data.dcl[1] - WPO.data.dcl[0];
//取消统计
//monitor.log(params, 'srp');
</script>